package com.example.blog.mapper;

import com.example.blog.model.UserInfo;
import org.apache.catalina.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Hua YY
 * Date: 2025-01-04
 * Time: 19:48
 */
@Mapper
public interface UserInfoMapper {
    /*
    * 根据用户名，返回用户信息
    * @return
    * */
    @Select("select id , user_name , password , github_url , delete_flag " +
            ", create_time , update_time from user where delete_flag = 0 and user_name = #{userName}")
    UserInfo selectByName(String userName);

    /**
     * 根据用户ID，查询用户信息
     */
    @Select("select id , user_name , password , github_url , delete_flag " +
            ", create_time , update_time from user where delete_flag = 0 and id = #{id}")
    UserInfo selectById(Integer id);


}
